package cx.cs.springframework.beans.util;

import java.lang.reflect.Field;

public class  BeanUtil {
    public static void setFieldValue(Object bean, String fieldName, Object value) {
        try{
            Class clazz = bean.getClass();
            Field field = clazz.getDeclaredField(fieldName);
            field.setAccessible(true);
            field.set(bean, value);
        }catch (Exception e){
            throw new RuntimeException(e);
        }

    }


}
